import { createRouter, createWebHistory } from 'vue-router'


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path:"/",
      // name: "Main",
      component:()=>import("@/views/Main.vue"),
      children:[
        {
          path:"",
          component:()=>import("@/views/goods.vue"),
        },
        {
          path:"goods",
          component:()=>import("@/views/goods.vue"),
        },
      ]
    },
    {
      path:"/person",
      component:()=>import("@/views/Person.vue"),
      children:[
        {
          path: '/set',
          component:()=>import("@/views/set.vue"),
        },
        {
          path: '/addGood',
          component:()=>import("@/views/addGood.vue"),
        },
        {
          path:'/classification',
          component:()=>import("@/views/Classification.vue"),
        },
        {
          path: '/ai',
          component:()=>import("@/views/AssistantDialog.vue"),
        },
        {
          path: '/ai2',
          component:()=>import("@/views/ai.vue")
        }
      ]
    },
    {
      path: "/admin",
      component:()=>import("@/views/Admin.vue"),
      children:[
        {
          path: "",
          component:()=>import("@/views/user.vue"),
        },
        {
          path: "/user",
          component:()=>import("@/views/user.vue"),
        },
      ]
    },
    {
      path: '/register',
      component:()=>import("@/views/Register.vue"),
    },
    {
      path: '/login',
      component:()=>import("@/views/Login.vue"),
    }
  ],
})

export default router
